-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Close spider by stats [#47][#50] #216
Conversation
) | ||
pipeline._set_crawler(crawler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not pass it as a parameter to cls()
?
if stat_current_value > max_errors_allowed: | ||
self.crawler.engine.close_spider( | ||
spider, | ||
'Spidermon: No of errors are greater then the expected no of errors {} > {}'.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not call them errors (they could be warnings or something else entirely), and I would include the name of the specific stat that triggers the spider closing.
'Spidermon: No of errors are greater then the expected no of errors {} > {}'.format( | |
'Spidermon: The value of stat {} ({}) went above the configured limit ({})'.format(stat_name, stat_current_value, max_errors_allowed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rosheen33 did you saw my comment on #47 ?
Just an initial version of the solution.
I have added a new setting in spidermon as proposed by @raphapassini above
Note: Documentation is not added so far
I have implemented the solution
Please have a look
#47
#50